﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl docsum xsi"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:docsum="http://www.ncbi.nlm.nih.gov/SNP/docsum">
  <xsl:output method="xml" indent="yes"/>
  <xsl:template match="/">
    <results>
      <result>
        <key>
          http://www.nibhi.org.uk/SharedGenomics#Organism
        </key>
        <value>
          <xsl:value-of select="docsum:ExchangeSet/docsum:Rs/docsum:Rs_organism"/>
        </value>
      </result>
      <result>
        <key>
          http://www.nibhi.org.uk/SharedGenomics#SNP
        </key>
        <value>
          <xsl:value-of select="docsum:ExchangeSet/docsum:Rs/docsum:Rs_rsId"/>
        </value>
      </result>
      <result>
        <key>
          http://www.nibhi.org.uk/SharedGenomics#EntrezGeneId
        </key>
        <xsl:for-each select="docsum:ExchangeSet/docsum:Rs/docsum:Rs_assembly/docsum:Assembly[docsum:Assembly_groupLabel='reference']/docsum:Assembly_component/docsum:Component/docsum:Component_mapLoc/docsum:MapLoc/docsum:MapLoc_fxnSet/docsum:FxnSet[1]">
          <value>
            <xsl:value-of select="docsum:FxnSet_geneId"/>
          </value>
        </xsl:for-each>
      </result>
      <result>
        <key>
          http://www.nibhi.org.uk/SharedGenomics#GeneName
        </key>
        <xsl:for-each select="docsum:ExchangeSet/docsum:Rs/docsum:Rs_assembly/docsum:Assembly[docsum:Assembly_groupLabel='reference']/docsum:Assembly_component/docsum:Component/docsum:Component_mapLoc/docsum:MapLoc/docsum:MapLoc_fxnSet/docsum:FxnSet[1]">
          <value>
            <xsl:value-of select="docsum:FxnSet_symbol"/>
          </value>
        </xsl:for-each>
      </result>
      <result>
        <key>
          http://www.nibhi.org.uk/SharedGenomics#Chromosome
        </key>
        <xsl:for-each select="docsum:ExchangeSet/docsum:Rs/docsum:Rs_assembly/docsum:Assembly[docsum:Assembly_groupLabel='reference']/docsum:Assembly_component/docsum:Component">
          <value>
            <xsl:value-of select="docsum:Component_chromosome"/>
          </value>
        </xsl:for-each>
      </result>
      <result>
        <key>
          http://www.nibhi.org.uk/SharedGenomics#ChromosomalPosition
        </key>
        <xsl:for-each select="docsum:ExchangeSet/docsum:Rs/docsum:Rs_assembly/docsum:Assembly[docsum:Assembly_groupLabel='reference']/docsum:Assembly_component/docsum:Component/docsum:Component_mapLoc/docsum:MapLoc">
          <value>
            <xsl:value-of select="docsum:MapLoc_physMapInt"/>
          </value>
        </xsl:for-each>
      </result>
    </results>
  </xsl:template>
</xsl:stylesheet>
